package com.bohua.intermediary.controller;

import com.bohua.intermediary.common.Lay;
import com.bohua.intermediary.common.Msg;
import com.bohua.intermediary.entity.SysRegister;
import com.bohua.intermediary.service.SysRegisterService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
/**
 * 控制器
 * @author qian
 * @email 1415261159@qq.com
 * @date 2019/01/19
 */
@Controller
@RequestMapping("/sysRegister")
public class SysRegisterController {
    @Resource
    private SysRegisterService sysRegisterService;

    @RequestMapping
    public String sysRegister(){
        return "sysRegister/sysRegister";
    }
    @RequestMapping("/add")
    public String add(){
        return "sysRegister/addSysRegister";
    }

    @RequestMapping("/update")
    public String update(){
        return "sysRegister/updateSysRegister";
    }

    @RequestMapping("/getSysRegisters")
    @ResponseBody
    public Lay getSysRegisters(SysRegister sysRegister,Integer page,Integer limit){
        return sysRegisterService.getSysRegisters(sysRegister,page,limit);
    }
    @RequestMapping("/addSysRegister")
    @ResponseBody
    public Msg addSysRegister(SysRegister sysRegister){
        return sysRegisterService.addSysRegister(sysRegister);
    }

    @RequestMapping("/updateSysRegister")
    @ResponseBody
    public Msg updateSysRegister(SysRegister sysRegister){
        return sysRegisterService.updateSysRegister(sysRegister);
    }

    @RequestMapping("/delSysRegister")
    @ResponseBody
    public Msg delSysRegister(SysRegister sysRegister){
        return sysRegisterService.delSysRegister(sysRegister);
    }
}
